package com.kung.qvs.entity;

import com.google.gson.annotations.SerializedName;
import com.kung.qvs.utils.Constants;

import java.io.Serializable;

/**
 * Created by gkm on 2018/02/11.
 * 邮箱 yueshangzhihen@163.com
 */

public class BaseResultBean<T> implements Serializable {
    @SerializedName("code")
    public String code;    //返回编码
    @SerializedName("token")
    public String token;    //返回编码
    @SerializedName("desc")
    public String desc; //返回结果描述
    @SerializedName("entity")
    public T entity;    //返回结果

    public boolean isSuccess(){
        return Constants.ReqSuccess.equals(code);
    }

    public boolean isTokenInvalid(){
        return Constants.ReqTokenInvalid.equals(code);
    }
}
